{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "8f201880",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1\n",
      "number is 1\n",
      "3\n",
      "number is 3\n",
      "5\n",
      "number is 5\n",
      "7\n",
      "number is 7\n"
     ]
    }
   ],
   "source": [
    "for i in range(10):\n",
    "    if i % 2 == 0:\n",
    "        continue\n",
    "    print(i)\n",
    "    print(f\"number is {i}\")\n",
    "    if i == 7:\n",
    "        break"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "14eef734",
   "metadata": {},
   "source": [
    "break"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "ca4de1ed",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Tom\n",
      "Abert\n"
     ]
    }
   ],
   "source": [
    "names = [\"Tom\", \"Abert\",\"Jerry\",\"Jack\"]\n",
    "for i in range(len(names)):\n",
    "    if i >= 2:\n",
    "        break\n",
    "    print(names[i])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "73d83cff",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Tom\n",
      "Abert\n",
      "Tom\n",
      "Abert\n",
      "Tom\n",
      "Abert\n"
     ]
    }
   ],
   "source": [
    "for i in range(3):\n",
    "    for i in range(len(names)):\n",
    "        if i >= 2:\n",
    "            break\n",
    "        print(names[i])"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0b468e1c",
   "metadata": {},
   "source": [
    "continue"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "c2a0f35a",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Tom\n",
      "Abert\n",
      "Jack\n"
     ]
    }
   ],
   "source": [
    "for i in range(len(names)):\n",
    "    if i == 2:\n",
    "        continue\n",
    "    print(names[i])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "f12d6857",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1\n",
      "3\n",
      "5\n",
      "7\n",
      "9\n",
      "1\n",
      "3\n",
      "5\n",
      "7\n",
      "9\n",
      "1\n",
      "3\n",
      "5\n",
      "7\n",
      "9\n"
     ]
    }
   ],
   "source": [
    "for i in range(3):\n",
    "    for i in range(10):\n",
    "        if i % 2 == 0:\n",
    "            continue\n",
    "        print(i)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "de8290d6",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "my_test",
   "language": "python",
   "name": "my_test"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
